<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - 会员管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__CSS__/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__CSS__/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="__CSS__/animate.css" rel="stylesheet">
    <link href="__CSS__/style.css?v=4.1.0" rel="stylesheet">
    <style>
        .pagination{
            margin-left: 500px;
        }
    </style>
</head>

<body class="gray-bg">
    <div><span class="lead"><strong>管理员列表</strong></span></div>
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="container">
                <form action="{:url('User/index')}" class="form" method="post">
                    <div class="form-group">
                        <div class="col-sm-10 ">
                            <input type="text" class="form-control" placeholder="请输入需要查询的用户" name="username">
                        </div>
                        <button type="submit">搜索</button>
                    </div>
                </form>
            </div>
            <div class="row">

                <button class="btn btn-default pull-right"><a href="{:url('User/modifyInsert')}">添加管理员</a></button>
                <button class="btn btn-primary pull-left">批量删除</button>
            </div>
            <div class="row">
            <table class="table table-hover table-bordered text-center">
                   <thead >
                      <tr >
                          <th class="text-center">勾选</th>

                         <th class="text-center">管理员账户</th>
                         <th class="text-center">管理员密码</th>
                         <th class="text-center">管理员个人电话</th>
                         <th class="text-center">管理员家庭电话</th>
                         <th class="text-center">管理员权限</th>
                         <th class="text-center">管理员操作</th>
                      </tr>
                   </thead>
                   <tbody>
                   {volist name='list' id='user'}
                   <tr >
                       <td><input type="checkbox"></td>
                       <td>{$user.username}</td>
                       <td>{$user.password}</td>
                       <td>{$user.mobile}</td>
                       <td>{$user.home_phone}</td>
                       {if condition="$user.power heq 1"}
                       <td><button type="button" content="{$user.id}" class="btn btn-danger xg" title="点击切换权限">高级</button></td>
                       {else/}
                       <td><button type="button" content="{$user.id}" class="btn  btn-info xg" title="点击切换权限">普通</button></td>
                       {/if}
                       <td><button class="btn btn-info" title="点击修改信息"><a href="{:url('User/administrators_modify')}?id={$user.id}">编辑</a></button> <button title="点击删除，请谨慎" class="btn btn-danger">
                           <a href="{:url('User/administrators_delete')}?id={$user.id}">删除</a></button></td>
                   </tr>
                   {/volist}
                   </tbody>
               </table>
            </div>

        </div>
    </div>

    <!-- 全局js -->
    <script src="__JS__/jquery.min.js?v=2.1.4"></script>
    <script src="__JS__/bootstrap.min.js?v=3.3.6"></script>

    <!-- 自定义js -->
    <script src="__JS__/content.js?v=1.0.0"></script>



    <script>
        $(document).ready(function () {
            $('.contact-box').each(function () {
                animationHover(this, 'pulse');
            });
        });

        $(function(){
           $(".xg").click(function(){
               $.ajax({
                   type: "post",
                   url: "{:url('User/power')}",
                   data: {
                       id: $(this).attr("content")
                   },
                   success: function (msg) {
                        history.go(0);
                   },
                   error: function (xhr, errorText, errorType) {
                       alert(xhr.response, errorText, errorType);
                   },
               })
           })
        })
    </script>

    
    

</body>

</html>
